# 导包
import jsonschema

# 创建数据
data_json = {
    "success": True,
    "code": 10000,
    "message": "操作成功",
    "money": 6.66,
}

# 规则
schema1 = {
    "tyoe": "object",
    "properties": {
        "success": {"const": True},
        "code": {"const": 10000},
        "message": {"const": "操作成功"},
        "money": {"const": 6.66}
    },
    "required": ["success", "code", "message", "money"]
}

resp = jsonschema.validate(instance=data_json, schema=schema1)
print(resp)
